package com.junyu.controller;

import com.junyu.common.Result;
import com.junyu.pojo.entity.User;
import com.junyu.service.RegisterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 注册Controller
 */
@RestController
@Api(description = "注册接口")
@CrossOrigin
public class RegisterController {
    @Autowired
    private RegisterService registerService;


    /**
     * 注册密码接口
     * @param user 用户对象
     * @return  Result
     */
    @ApiOperation(value = "注册", notes = "测试使用")
    @PostMapping("/register")
    public Result register(@RequestBody User user) {
        this.registerService.register(user);
        return Result.ok();
    }

}
